package parallels.servertech.client;

import java.io.IOException;

import parallels.servertech.client.commands.AddHandler;
import parallels.servertech.client.commands.ConnectHandler;
import parallels.servertech.client.commands.DisconnectHandler;
import parallels.servertech.client.commands.ExitHandler;
import parallels.servertech.client.commands.ShutdownHandler;

public class Client {
	public static void main(String[] args) {
		try {
			CommandProcessor processor = new CommandProcessor(System.in, System.out);
			processor.addHandler("exit", new ExitHandler());
			processor.addHandler("connect", new ConnectHandler());
			processor.addHandler("add", new AddHandler());
			processor.addHandler("shutdown", new ShutdownHandler());
			processor.addHandler("disconnect", new DisconnectHandler());
			while (true) {
				processor.handle();
			}
		} catch (IOException ioe) {
			ioe.printStackTrace(System.err);
			return;
		}
	}
}